#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
const int N = 100005;
int n, m, du[N], S[N];
int getf (int x) {
	if (S[x] == x) {
		return x;
	}
	return S[x] = getf(S[x]);
}
void merge (int x, int y) {
	int u = getf(x);
	int v = getf(y);
	if (u != v) {
		S[u] = v;
	}
} 
int main() {
	while (~scanf("%d%d", &n, &m)) {
		int a, b;
		for (int i = 0; i <= n; i++) {
			S[i] = i;
		}
		for (int i = 1; i <= m; i++) {
			scanf ("%d%d", &a, &b);
			merge(a, b);
			du[a]++;
			du[b]++;
		}
		int cnt = 0;
		for (int i = 1; i <= n; i++) {
			if (du[i] % 2 == 1) {
				cnt++;
			}
		}
		cnt = (cnt + 1) / 2;
		if (cnt == 0) {
			for (int i = 1; i <= n; i++) {
				if (S[i] == i && du[i] != 0) {
					cnt++;
				}
			}
		}
		if (m == 0) {
			cnt = 0;
		}
		printf ("%d\n", cnt);
		memset (du, 0, sizeof(du));
	}
	return 0;
}
